/**
 * @function:  create a XHR object.
 * @returns {XMLHttpRequest}
 */

function createXMLHttpRequest() {
    var xhr ;
    // for NON-IE: standard version.
    if(window.XMLHttpRequest) {
        xhr = new XMLHttpRequest();
        // for IE
    } else if(window.ActiveXObject) {
        try {
            xhr = new ActiveXObject("Msxml2.XMLHTTP");
        }catch(e) {
            // for old IE version, ie. IE 7 , 6, etc.
            try{
                xhr = new ActiveXObject("Microsoft.XMLHTTP");
            } catch(e){
                console.log("XHR创建失败！") ;
            }
        }
    }
    return xhr ;
}